package com.wxg.ch02;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main02 {
    public static void main(String[] args) throws PerformanceException {
        ApplicationContext ctx = new ClassPathXmlApplicationContext(
                "ch02/xml02.xml");
        Performer performer = (Performer) ctx.getBean("duke");
        performer.perform();

        System.out.println("=========");

        performer = (Performer) ctx.getBean("duke2");
        performer.perform();

        System.out.println("=========");

        performer = (Performer) ctx.getBean("poeticDuke");
        performer.perform();

        System.out.println("=========");

        performer = (Performer) ctx.getBean("kenny2");
        performer.perform();
    }
}
